
#ifndef _MEMBER_BPainter_H_
#define _MEMBER_BPainter_H_

#include <BRect>
#include <BColor>
#include <BMatrix>
#include <BFont>
#include <BStyle>
#include <BWidget>
#include <BPixmap>
#include <BPainter>
#include "IGLState.h"
#include "IState.h"

#define painter_member(painter)		((member_BPainter*)((BPainter*)painter)->_ptr)

namespace BWE
{
	class member_BPainter : public IGLState
	{
	public:
		member_BPainter(BPainter* painter);
		~member_BPainter();

		const BColor* findColor(int name);
		const BColor* findColor(const char* name);
		const BColor* findColor(const BString& name);

		const BImage* findImage(int name);
		const BImage* findImage(const char* name);
		const BImage* findImage(const BString& name);

		void createPoints(const BRectf& rect, float rx, float ry);
		void createPoints(const BRectd& rect, double rx, double ry);

		BPainter*			boss;
		const BWidget*		widget;
		const BPixmap*		pixmap;
		const BGlyph*		graphic;
		IState				state;
		BSize				size;
		BRect				clip;
		BColor				color;
		BPointfArray		floatPoints;
		BPointdArray		doublePoints;
		BMatrix				matrix;
		BReal				scale;

		BUInt				tbo;
		BSize				tsize;
		BRect				trect;
		const BStyle*		style;
		const BFont*		font;
		const BProgram*		program;
		bool				cullback;
		bool				pointSmooth;
		float				pointSize;
		GLint				lineStipple;
		bool				lineSmooth;
		float				lineWidth;
		bool				polySmooth;
	};
}

#endif
